# Maintainer: Daniel M. Capella <polyzen@archlinux.org>
# Maintainer: Alexander Epaneshnikov <alex19ep@archlinux.org>
# Contributor: Christoph Brill <egore911@gmail.com>

_name=pytesseract
pkgname=python-pytesseract
pkgver=0.3.10
pkgrel=2
pkgdesc='Python wrapper for Google Tesseract'
arch=('any')
url=https://github.com/madmaze/pytesseract
license=('Apache')
depends=('python-packaging' 'python-pillow' 'tesseract')
makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-wheel')
checkdepends=('python-pytest' 'tesseract-data-eng' 'tesseract-data-fra')
source=("$url/archive/v$pkgver/$_name-v$pkgver.tar.gz")
b2sums=('d89f9082d8c7236b97bb96441809a19f494aacd23d4c02d5b7fb1b742616e7b26c249d49fceecc4f652792cdc3d7f2a79cd580a3360157f81205ff04d65afb10')

build() {
  cd $_name-$pkgver
  python -m build --wheel --skip-dependency-check --no-isolation
}

check() {
  cd $_name-$pkgver
  python -m venv --system-site-packages test-env
  test-env/bin/python -m installer dist/*.whl
  test-env/bin/python -m pytest
}

package() {
  cd $_name-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
}

# vim:set ts=2 sw=2 et:
